package com.lggry.demo6collection;

import java.util.ArrayList;

public class CollectionTravelsalTest {
    public static void main(String[] args) {
        //目标：认识并发修改异常问题，搞清楚每种遍历的区别
        ArrayList<String> list = new ArrayList<>();
        list.add("Java");
        list.add("C++");
        list.add("Python");

        for (int i = 0; i < list.size(); i++) {
            String name = list.get(i);
            if (name.equals("Java")) {
                list.remove(name);
            }
        }
        System.out.println(list);
    }
}
